#!/usr/bin/env python
#coding=utf-8
import sys
import time
from oss.oss_api import *

endpoint=sys.argv[1]
accessKeyId, accessKeySecret=sys.argv[2],sys.argv[3]
bucket=sys.argv[4]
archive = sys.argv[5]
object=sys.argv[6]
oss = OssAPI(endpoint, accessKeyId, accessKeySecret)
res=oss. copy_object(bucket,object,bucket,object+str(time.time()));
res = oss.put_object_from_file(bucket, object, archive)
print "上传成功:"
print "http://%s.%s/%s" % (bucket,endpoint,object)

